home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 4 / MacMania 4.toast / / Over 200 Fonts / Misc. / gregs-hack / hack.c < prev    next >
Text File  |  1995-06-23  |  1KB  |  46 lines

  1. /*
  2.      Greg's Hack — MacHack '95 Best Hack Contest (22-24 June 1995 )
  3.     Copyright © 1995 Gregory D. Landweber, ALL RIGHTS RESERVED
  4. */
  5.  
  6. #include <A4Stuff.h>
  7. #include "AntiAlias.h"
  8.  
  9. UniversalProcPtr    oldDrawString;
  10. UniversalProcPtr    oldDrawText;
  11. UniversalProcPtr    oldDrawChar;
  12.  
  13. ProcInfoType __procinfo = kCStackBased;
  14.  
  15. void main ( void )
  16. {
  17.     UniversalProcPtr    _MyDrawString;
  18.     UniversalProcPtr    _MyDrawText;
  19.     UniversalProcPtr    _MyDrawChar;
  20.     
  21.     Handle    me = Get1Resource ( 'INIT', 1000 );
  22.     THz        oldZone = GetZone();
  23.     
  24.     EnterCodeResource();
  25.  
  26.     SetZone ( SystemZone() );
  27.     
  28.     if ( me && !Button() && AntiAlias() ) {
  29.         DetachResource ( me );
  30.     
  31.         oldDrawString = GetToolTrapAddress ( _DrawString );
  32.         oldDrawText = GetToolTrapAddress ( _DrawText );
  33.         
  34.         _MyDrawString = NewRoutineDescriptor ( (ProcPtr)MyDrawString, uppDrawStringProcInfo, GetCurrentISA() );
  35.         _MyDrawText = NewRoutineDescriptor ( (ProcPtr)MyDrawText, uppDrawTextProcInfo, GetCurrentISA() );
  36.         _MyDrawChar = NewRoutineDescriptor ( (ProcPtr)MyDrawChar, uppDrawCharProcInfo, GetCurrentISA() );
  37.  
  38.         SetToolTrapAddress ( _MyDrawString, _DrawString );
  39.         SetToolTrapAddress ( _MyDrawText, _DrawText );
  40.     //    SetToolTrapAddress ( _MyDrawChar, _DrawChar );
  41.     }
  42.     
  43.     SetZone ( oldZone );
  44.     
  45.     ExitCodeResource();
  46. }